-- GENERATED SPELL FOR [Heretic Crystal Guard] --


function spell0_26166(pUnit, Event) --@Battle Stance,Self--
pUnit:FullCastSpellOnTarget(7165,pUnit)
pUnit:RegisterEvent('Sorts_26166', 629, 1)
end

function spell1_26166(pUnit, Event) --@Hamstring,n/a--
pUnit:FullCastSpellOnTarget(9080,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26166', 10278, 1)
end

function spell2_26166(pUnit, Event) --@Localized Toxin,n/a--
pUnit:FullCastSpellOnTarget(7947,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26166', 0, 1)
end

function spell3_26166(pUnit, Event) --@Rend,n/a--
pUnit:FullCastSpellOnTarget(11977,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_26166', 15000, 1)
end

function Sorts_26166(pUnit, Event)
local choix_sorts_26166 = math.random(0, 3)
if choix_sorts_26166 == 0 then
pUnit:RegisterEvent('spell0_26166', 1, 1)
end
if choix_sorts_26166 == 1 then
pUnit:RegisterEvent('spell1_26166', 1, 1)
end
if choix_sorts_26166 == 2 then
pUnit:RegisterEvent('spell2_26166', 1, 1)
end
if choix_sorts_26166 == 3 then
pUnit:RegisterEvent('spell3_26166', 1, 1)
end
end

function mob26166_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_26166', math.random(1500, 3000), 1)
end

function mob26166_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26166_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob26166_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(26166, 1, 'mob26166_Action')
RegisterUnitEvent(26166, 2, 'mob26166_Leave')
RegisterUnitEvent(26166, 3, 'mob26166_Kill')
RegisterUnitEvent(26166, 4, 'mob26166_Die')
